package com.tyut.service.impl;

import com.tyut.mapper.CollectMapper;
import com.tyut.pojo.Collect;
import com.tyut.service.CollectService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class CollectServiceImpl implements CollectService {
    @Resource
    private CollectMapper collectMapper;

    //根据用户的 id 查找景点的id，
    //然后根据景点id返回景点数据(景点mapper中已经实现)
    public List<Integer> queryTravelIdByCustomerId(Integer cid) {
        return collectMapper.queryTravelIdByCustomerId(cid);
    }

    public boolean deleteCollectById(Collect collect) {

        return collectMapper.deleteCollectById(collect) > 0;
    }

    public boolean addCollect(Collect collect) {
        return collectMapper.addCollect(collect) > 0;
    }
}
